package com.example.demo.controller;

import com.example.demo.model.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {
    @GetMapping("hello")
    public String hello(){return "Hello World!!!";
    }

    @GetMapping("stu")
    public Student stu(){
        return new Student("3","tom");
    }

    @GetMapping("list2")
    public List<Student> list(){
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("1","jerry"));
        students.add(new Student("2","jack"));
        return students;
    }

}
